public class ArithmeticOperatorsDemo1 {
    public static void main(String[] args){
        // 定义两个变量，分别求出和差积商 （+ - * /）
        int num1 = 10;
        int num2 = 20;
        int num3 = num2 + num1;
        int num4 = num2 - num1;
        int num5 = num2 / num1;
        int num6 = num2 * num1;
        System.out.println("num2 + num1="+num3);
        System.out.println("num2 - num1="+num4);
        System.out.println("num2 / num1="+num5);
        System.out.println("num2 * num1="+num6);


        //取模,求余数（%）
        int num7 = 100;
        int num8 = 23;
        int num9 = num7 % num8;
        System.out.println("num7 % num8 = "+ num9);

        //演示“+”号表示连接符号的例子
        System.out.println("我"+"爱"+"中"+"国");
        //演示8765 / 1000 * 1000，说明结果为什么是8000
        System.out.println(8765/1000 *1000); //800

        // 演示10 / 0，并说明报错原因
        //System.out.println(10/0);

        // 演示前置++
        int num_1=10;
        int num_2 = 20;
        int num_3 = ++num_1 +num_2;
        System.out.println("num="+num_3);
        System.out.println("num_1="+num_1);

        //演示后置++
        int num_4 = 10;
        int num_5 = 20;
        int num_6 = num_4++ + num_5;
        System.out.println("num_6="+num_6);
        System.out.println("num_4="+num_4);




    }
}
